#include "PDTExpNumBin.h"
#include "PDTCodeGraph.h"

PDTExpNumBin::PDTExpNumBin(PDTCodeGraph & CG):PDTExpNum(CG){
	//maybe intialize to some value
}

void PDTExpNumBin::setLeft(PDTExpNum&left){
	writers[0]=&left;
	addChild(&left);
	left.addReader(this);
	left.addParent(this);
}
void PDTExpNumBin::setRight(PDTExpNum &right){
	writers[1]=&right;
	addChild(&right);
	right.addReader(this);
	right.addParent(this);
}


PDTExpNumBin::PDTExpNumBin(PDTCodeGraph & CG,PDTExpNum &left,PDTExpNum & right):PDTExpNum(CG){
	addWriter(&left);
	addChild(&left);
	left.addReader(this);
	left.addParent(this);


	addWriter(&right);
	addChild(&right);
	right.addReader(this);
	right.addParent(this);

}

PDTExpNum * PDTExpNumBin::getLeft(){
	return dynamic_cast<PDTExpNum*>(writers[0]);
}

PDTExpNum * PDTExpNumBin::getRight(){
	return dynamic_cast<PDTExpNum*>(writers[1]);
}

